exports.__esModule = true;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

exports.default = class extends think.BaseController {

    /**
     * 条件统计查询区域立案数
     * 
     * @returns 
     */
    AreaStatisAction() {
        var _this = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const data = {
                area_code: _this.post('area_code'),
                startTime: _this.post('startTime'), //2018-02-10
                endTime: _this.post('endTime') //2018-02-13
            };
            const AreaService = _this.service('api/statistics/AreaService');
            const res = yield AreaService.AreaStatis(data);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '区域案卷信息统计失败';
            }
            return _this.json(aj);
        })();
    }

};